use hypers::oapi::{ToParameter, ToSchema};
use rbatis::rbdc::datetime::DateTime;
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, ToSchema, Clone)]
#[hypers(schema(rename_all = "camelCase"))]
#[serde(rename_all(serialize = "camelCase"))]
pub struct SysPostList {
    pub post_id: Option<i64>,
    pub post_code: Option<String>,
    pub post_name: Option<String>,
    pub post_sort: Option<i8>,
    pub status: Option<String>,
    pub create_by: Option<String>,
    pub create_time: Option<DateTime>,
    pub update_by: Option<String>,
    pub update_time: Option<DateTime>,
}

#[derive(Debug, Serialize, Deserialize, ToParameter, Clone)]
#[hypers(parameter(rename_all = "camelCase",default_parameter_in = Query))]
#[serde(rename_all(deserialize = "camelCase"))]
pub struct SysPostListPayload {
    pub page_num: u64,
    pub page_size: u64,
    pub post_code: Option<String>,
    pub post_name: Option<String>,
    pub status: Option<String>,
}

#[derive(Debug, Serialize, Deserialize, ToSchema, Clone)]
#[hypers(schema(rename_all = "camelCase"))]
#[serde(rename_all(deserialize = "camelCase"))]
pub struct SysPostModifyPayload {
    pub post_id: Option<i64>,
    pub post_code: Option<String>,
    pub post_name: Option<String>,
    pub post_sort: Option<i8>,
    pub status: Option<String>,
    pub remark: Option<String>,
}
